package au.com.introprogexercise.core.tests;

import au.com.introprogexercise.core.excercises.DiamondExercise;
import org.junit.Test;
import org.junit.Assert;

/**
 * Created by olga on 30/05/14.
 */
public class DiamondExerciseTests
{
    @Test
    public void testIfMaximumNumberOfAsterisksInDiamondWithOneRowIsOne()
    {
        Assert.assertEquals(1, DiamondExercise.getMaximumNumberOfAsterisksInDiamond(1));
    }

    @Test
    public void testIfMaximumNumberOfAsterisksInDiamondWithTwoRowsIsThree()
    {
        Assert.assertEquals(3, DiamondExercise.getMaximumNumberOfAsterisksInDiamond(2));
    }

    @Test
    public void testIfMaximumNumberOfAsterisksInDiamondWithThreeRowsIsFive()
    {
        Assert.assertEquals(5, DiamondExercise.getMaximumNumberOfAsterisksInDiamond(3));
    }

    @Test
    public void testIfMaximumNumberOfAsterisksInDiamondWithFiveRowsIsNine()
    {
        Assert.assertEquals(9, DiamondExercise.getMaximumNumberOfAsterisksInDiamond(5));
    }

    @Test
    public void testIfMaximumNumberOfAsterisksInDiamondWithSevenRowsIsThirteen()
    {
        Assert.assertEquals(13, DiamondExercise.getMaximumNumberOfAsterisksInDiamond(7));
    }

    @Test
    public void testIfMiddleAsterisksPositionIsZeroIfZeroMaximumAsterisks()
    {
        Assert.assertEquals(0, DiamondExercise.getMiddleAsteriskPosition(0));
    }

    @Test
    public void testIfMiddleAsterisksPositionIsOneIfOneAsterisksSet()
    {
        Assert.assertEquals(1, DiamondExercise.getMiddleAsteriskPosition(1));
    }

    @Test
    public void testIfMiddleAsterisksPositionIsOneIfTwoAsterisksSet()
    {
        Assert.assertEquals(2, DiamondExercise.getMiddleAsteriskPosition(2));
    }

    @Test
    public void testIfMiddleAsterisksPositionIsThreeIfThreeAsterisksSet()
    {
        Assert.assertEquals(2, DiamondExercise.getMiddleAsteriskPosition(3));
    }

    @Test
    public void testIfMiddleAsterisksPositionIsFourIfSevenAsterisksSet()
    {
        Assert.assertEquals(4, DiamondExercise.getMiddleAsteriskPosition(7));
    }

    @Test
    public void testIfMiddleAsterisksPositionIsSevenIfTirteenAsterisksSet()
    {
        Assert.assertEquals(7, DiamondExercise.getMiddleAsteriskPosition(13));
    }
}
